<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@page import="com.zmht.specedu.vo.Fengongtype"%>
<%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean" %>
<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html" %>
<%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic" %>
<%@ taglib uri="http://struts.apache.org/tags-tiles" prefix="tiles" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>

<%
	/**
	 * @author 张天兴
	 * @since 2009/05/08
	 */

 %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>聋校语言学习及矫治系统</title>
<link href="<%=request.getContextPath() %>/reference/datePicker/skin/WdatePicker.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="<%=request.getContextPath() %>/reference/js/jquery.js"></script>
<script src="<%=request.getContextPath() %>/reference/WebCalendar.js" type="text/javascript"></script>


<fmt:setBundle basename="PathResource" scope="session" />
<link href="<%=request.getContextPath()%>/<fmt:message key='StylePath' />style.css" rel="stylesheet" type="text/css" />
<script type="text/javascript"
	src="<fmt:message key='datePicker' />WdatePicker.js">
	</script>
<script type="text/javascript">
function chooseitem()
{
  
  var sel1=document.dxclassForm.select1;
  var sel2=document.dxclassForm.select2;
  
  var ops=sel1.options;
  for(var i=0;i<sel1.options.length;i++){
	if(sel1.options[i].selected){
		sel2.options.add(new Option(sel1.options[i].text,sel1.options[i].value));
  		sel1.options.remove(i);
  		i=i-1;
	}
  }
}

function cancelitem()
{
  var sel1=document.dxclassForm.select1;
  var sel2=document.dxclassForm.select2;
  
  var op=sel2.options;
  for(var i=0;i<sel2.options.length;i++){
	if(sel2.options[i].selected){
		sel1.options.add(new Option(sel2.options[i].text,sel2.options[i].value));
  		sel2.options.remove(i);
  		i=i-1;
	}
  }  
  
}
function chooseallitem()
{
  var sel1=document.dxclassForm.select1;
  var sel2=document.dxclassForm.select2;
  
  for(k=0;k<sel1.length;k++)
  {
   var op=sel1.options[k];
   sel2.options.add(new Option(op.text,op.value));
  }
  sel1.length=0;
}
function cancelallitem()
{

  var sel1=document.dxclassForm.select1;
  var sel2=document.dxclassForm.select2;
  
  for(k=0;k<sel2.length;k++)
  {
   var op=sel2.options[k];
   sel1.options.add(new Option(op.text,op.value));
  }
  sel2.length=0;
}

 function check(obj)
 {
           
			if(document.forms[0].fenpeiTime.value==""){
				alert("请输入单训课分配日期!");
				document.forms[0].fenpeiTime.focus();
				return false;
			}
			
			if(document.forms[0].name.value==""){
				alert("单训班级名称！");
				document.forms[0].name.focus();
				return false;
			}
			
			if(document.forms[0].term.value==""){
				alert("请输入单训课分配学期,必须是正整数1-99！！");
				document.forms[0].term.focus();
				return false;
			}			 
			  var regw =  /^\+?[1-9][0-9]*$/;　　//正整数 
			  var term=document.forms[0].term.value;
	            if(!regw.test(term) || term>99){
	             alert("单训课分配学期格式不正确，必须是1-99之间的一个值!");
	             return false;
	             }	
			
			var remark=document.forms[0].remark.value;  
			 if(remark.length>200){
	             alert("其他说明格式不正确,只允许200字以内!");
	             return false;
	             }		     
			
			var sel2=document.dxclassForm.select2;
			  for(k=0;k<sel2.length;k++)
			  {
			   var op=sel2.options[k];
			   op.selected=true;
			  }
			  
			var p=document.forms[0].teacherId;
			document.forms[0].teachName.value=p.options[p.selectedIndex].text;
  
     // document.forms[0].submit();
  
 } 
 
</script>	
	
</head>

<body>
<html:form  method="post" action="dxclassAction.do"  onsubmit="return check(this);">
  <input type=hidden name="method" value="update" />
  <html:hidden name="dxclassForm" property="onlyClassId"/>
  
  <table cellspacing="0" cellpadding="0" width="99%" align="center" border="0">
    <tbody>
      <tr>
        <td width="7"><img height="38" alt="" src="<%=request.getContextPath() %>/<fmt:message key='CommonImagePath' />table_1_01.gif"    width="7" /></td>
        <td background="<%=request.getContextPath() %>/<fmt:message key='CommonImagePath' />table_1_05.gif"><table cellspacing="0" cellpadding="0" width="100%" border="0">
            <tbody>
              <tr>
                <td width="30"><img height="38" alt="" src="<%=request.getContextPath() %>/<fmt:message key='CommonImagePath' />table_1_02.gif" 
            width="30" /></td>
                <td align="left" width="200" 
            background="<%=request.getContextPath() %>/<fmt:message key='CommonImagePath' />table_1_03.gif">&nbsp;<b>编 辑 单 训 班 级</b></td>
                <td width="59"><img height="38" alt="" src="<%=request.getContextPath() %>/<fmt:message key='CommonImagePath' />table_1_04.gif" 
            width="59" /></td>
                <td>&nbsp;</td>
              </tr>
            </tbody>
        </table></td>
        <td width="8"><img height="38" alt="" src="<%=request.getContextPath() %>/<fmt:message key='CommonImagePath' />table_1_06.gif" 
      width="8" /></td>
      </tr>
      <tr>
        <td background="<%=request.getContextPath() %>/<fmt:message key='CommonImagePath' />table_1_07.gif"><img height="1" 
      src="<%=request.getContextPath() %>/<fmt:message key='CommonImagePath' />spacer.gif" width="1" /></td>
        <td bgcolor="#f7fbff"><table cellspacing="0" bordercolordark="#ccccff" cellpadding="0" width="100%" bordercolorlight="#ffffff" border="0">
            <tbody>
              <tr bgcolor="#a4c9ec">
                <td align="middle"><table width="100%" border="0" cellpadding="3" cellspacing="1" bgcolor="#a4c9ec" class="fontbot">
                    <tr>
                      <td width="20%" height="20" align="right" valign="middle" bgcolor="#e6f0f8">单训课分配日期：</td>
                      <td height="20" align="left" valign="middle" bgcolor="#FFFFFF">
                 <input name="fenpeiTime" type="text"  id="textfield18" value="<c:out value="${dxclassForm.fenpeiTime}" />"
						class="Wdate" onClick="SelectDate(this,'yyyy-MM-dd')" style="width:100px;" maxlength="4"/>
                   <span class="STYLE4">*</span></td>
                    </tr>
                </table></td>
              </tr>
              <tr bgcolor="#ffffff">
                <td><table width="100%" border="0" cellpadding="3" cellspacing="1" bgcolor="#a4c9ec" class="fontbot">
                    <tr>
                      <td width="20%" height="20" align="right" valign="middle" bgcolor="#e6f0f8">单训班级名称：</td>
                      <td height="20" align="left" valign="middle" bgcolor="#FFFFFF"><input name="name" type="text" class="boxcopy2" id="textfield10"  style="width:100px;" value="<bean:write name="dxclassForm" property="name" />"/>
                  <span class="STYLE4">*</span></td>
                    </tr>
                </table></td>
              </tr>
              <tr bgcolor="#ffffff">
                <td><table width="100%" border="0" cellpadding="3" cellspacing="1" bgcolor="#a4c9ec" class="fontbot">
                    <tr>
                      <td width="20%" height="20" align="right" valign="middle" bgcolor="#e6f0f8">单训课分配学期：</td>
                      <td height="20" align="left" valign="middle" bgcolor="#FFFFFF"><input name="term" type="text"  value="<bean:write name="dxclassForm" property="term" />" class="boxcopy2"  id="textfield11"  style="width:100px;"/>
                      <span class="STYLE4">*</span></td>
                    </tr>
                </table></td>
              </tr>
              <tr bgcolor="#ffffff">
                <td><table width="100%" border="0" cellpadding="3" cellspacing="1" bgcolor="#a4c9ec" class="fontbot">
                    <tr>
                      <td width="20%" height="20" align="right" valign="middle" bgcolor="#e6f0f8">单训教师姓名：</td>
                      <td height="20" align="left" valign="middle" bgcolor="#FFFFFF">
                      <html:select name="dxclassForm" property="teacherId"  styleClass="boxcopy2"  style="width:104px;">
	                  <html:optionsCollection name="teachers" label="tname" value="teacherId"/>
	                  </html:select> 
	                  <input type=hidden name="teachName" />
                      
                      </td>
                    </tr>
                </table></td>
              </tr>
              <tr bgcolor="#ffffff">
                <td><table width="100%" border="0" cellpadding="3" cellspacing="1" bgcolor="#a4c9ec" class="fontbot">
                    <tr>
                      <td width="20%" height="20" align="right" valign="middle" bgcolor="#e6f0f8">特殊需要备注说明：</td>
                      <td height="20" align="left" valign="middle" bgcolor="#FFFFFF">
                      <textarea name="remark" rows="5" class="boxcopy2" id="textfield18" style="width:84%;" onpropertychange="if(value.length>125) value=value.substr(0,125)"><bean:write name="dxclassForm" property="remark" /></textarea>
                      (200字以内)
                      </td>
                    </tr>
                </table></td>
              </tr>
              <tr bgcolor="#ffffff">
                <td><table width="100%" border="0" cellpadding="3" cellspacing="1" bgcolor="#a4c9ec" class="fontbot">
                    <tr>
                      <td width="20%" height="20" align="right" valign="middle" bgcolor="#e6f0f8">上课频率安排：</td>
                      <td height="20" align="left" valign="middle" bgcolor="#FFFFFF">
		                <select name="teachPlan" class="boxcopy2"  style="width:104px;">
		                  <option <logic:equal name="dxclassForm" property="teachPlan"  value="每日1次"> selected </logic:equal>>每日1次</option>
		                  <option <logic:equal name="dxclassForm" property="teachPlan"  value="第周3次"> selected </logic:equal>>第周3次</option>
		                  <option <logic:equal name="dxclassForm" property="teachPlan"  value="每周2次"> selected </logic:equal>>每周2次</option>
		                  <option <logic:equal name="dxclassForm" property="teachPlan"  value="每周1次"> selected </logic:equal>>每周1次</option>
		                  <option <logic:equal name="dxclassForm" property="teachPlan"  value="每月3次"> selected </logic:equal>>每月3次</option>
		                  <option <logic:equal name="dxclassForm" property="teachPlan"  value="第周3次"> selected </logic:equal>>第周3次</option>
		                  <option <logic:equal name="dxclassForm" property="teachPlan"  value="每月1次"> selected </logic:equal>>每月1次</option>
		                  <option <logic:equal name="dxclassForm" property="teachPlan"  value="其他"> selected </logic:equal>>其他</option>
		                </select>
                      </td>
                    </tr>
                </table></td>
              </tr>

              <tr bgcolor="#ffffff">
                <td><table width="100%" border="0" cellpadding="3" cellspacing="1" bgcolor="#a4c9ec" class="fontbot">
                    <tr>
                      <td width="20%" height="20" align="right" valign="middle" bgcolor="#e6f0f8">每次单训时间安排：</td>
                      <td height="20" align="left" valign="middle" bgcolor="#FFFFFF">
                     <select name="timePlan" class="boxcopy2"  style="width:104px;">
	                  <option <logic:equal name="dxclassForm" property="timePlan"    value="20分钟"> selected </logic:equal>>20分钟</option>
	                  <option <logic:equal name="dxclassForm" property="timePlan"    value="30分钟"> selected </logic:equal>>30分钟</option>
	                  <option <logic:equal name="dxclassForm" property="timePlan"    value="40分钟"> selected </logic:equal>>40分钟</option>
	                  <option <logic:equal name="dxclassForm" property="timePlan"    value="50分钟"> selected </logic:equal>>50分钟</option>
	                  <option <logic:equal name="dxclassForm" property="timePlan"    value="60分钟"> selected </logic:equal>>60分钟</option>
	                  <option <logic:equal name="dxclassForm" property="timePlan"    value="90分钟"> selected </logic:equal>>90分钟</option>
	                  <option <logic:equal name="dxclassForm" property="timePlan"    value="120分钟"> selected </logic:equal>>120分钟</option>
	                  
	                </select>
                      </td>
                    </tr>
                </table></td>
              </tr>

              <tr bgcolor="#ffffff">
                <td height="1" bgcolor="#ffffff"></td>
              </tr>
              <tr bgcolor="#ffffff">
                <td><table width="100%" border="0" cellpadding="3" cellspacing="1" bgcolor="#a4c9ec" class="fontbot">
                    <tr>
                      <td height="20" align="right" valign="middle" bgcolor="#e6f0f8"><p align="center"><strong>选择学生</strong></p></td>
                    </tr>
                </table></td>
              </tr>
              <tr bgcolor="#ffffff">
                <td><table width="100%" border="0" cellpadding="3" cellspacing="1" bgcolor="#a4c9ec" class="fontbot">
                    <tr>
                      <td width="40%" height="20" align="right" valign="middle" bgcolor="#FFFFFF"><table width="200" border="0" cellspacing="0" cellpadding="0">
                          <tr>
                            <td align="center"><strong>未被选择的学生姓名</strong></td>
                          </tr>
                          <tr>
                            <td align="right">
						<html:select property="select1" styleClass="boxcopy2"  style="width:200px;" multiple="8" size="6">
                             <html:optionsCollection name="studentlist" label="sname" value="studentId"/>
                        </html:select>

                            </td>
                          </tr>
                      </table></td>
                      <td width="20%" height="20" align="center" valign="middle" bgcolor="#E6F0F8"><table width="100%" border="0" cellspacing="10" cellpadding="0">
                          <tr>
                            <td align="center"><a href="javascript:chooseitem();" onfocus="this.blur()"><img src="<%=request.getContextPath() %>/<fmt:message key='CommonImagePath' />gif-04.gif" width="63" height="22" border="0" /></a></td>
                          </tr>
                          <tr>
                            <td align="center"><a href="javascript:cancelitem();" onfocus="this.blur()"><img src="<%=request.getContextPath() %>/<fmt:message key='CommonImagePath' />gif-05a.gif" width="63" height="22" border="0" /></a></td>
                          </tr>
                          <tr>
                            <td align="center"><a href="javascript:chooseallitem();" onfocus="this.blur()"><img src="<%=request.getContextPath() %>/<fmt:message key='CommonImagePath' />gif-06.gif" width="63" height="22" border="0" /></a></td>
                          </tr>
                          <tr>
                            <td align="center"><a href="javascript:cancelallitem();" onfocus="this.blur()"> <img src="<%=request.getContextPath() %>/<fmt:message key='CommonImagePath' />gif-07.gif" width="63" height="22" border="0" /></a></td>
                          </tr>
                      </table></td>
                      <td width="40%" align="left" valign="middle" bgcolor="#FFFFFF"><table width="200" border="0" cellspacing="0" cellpadding="0">
                          <tr>
                            <td align="center"><strong>已被选择的学生姓名</strong></td>
                          </tr>
                          <tr>
                            <td align="right">
                           <html:select property="select2" styleClass="boxcopy2"  style="width:200px;" multiple="8" size="6">
                             <html:optionsCollection name="list4" label="sname" value="studentId"/>
                           </html:select>
                            
                            </td>
                          </tr>
                      </table></td>
                    </tr>
                    
                </table></td>
              </tr>
            </tbody>
          </table>
            <table cellspacing="1" cellpadding="0" width="100%" bgcolor="#ffffff"   border="0">
              <tbody>
                <tr>
                  <td align="middle" bgcolor="#e6f0f8"><table cellspacing="0" cellpadding="3" width="100%" border="0">
                      <tbody>
                        <tr>
                          <td width="50%" align="right"><input type="image" src="<%=request.getContextPath() %>/<fmt:message key='CommonImagePath' />jz_img/xiugai.gif" width="53" height="22" border="0" /></td>
                          <td width="50%" align="left"><a href="javascript:document.forms[0].reset();" onfocus="this.blur()"><img src="<%=request.getContextPath() %>/<fmt:message key='CommonImagePath' />gif-02.gif" width="53" height="22" border="0" /></a></td>
                        </tr>
                      </tbody>
                  </table></td>
                </tr>
              </tbody>
          </table></td>
        <td background="<%=request.getContextPath() %>/<fmt:message key='CommonImagePath' />table_1_09.gif"><img height="1"  src="<%=request.getContextPath() %>/<fmt:message key='CommonImagePath' />spacer.gif" width="1" /></td>
      </tr>
      <tr>
        <td><img height="22" alt="" src="<%=request.getContextPath() %>/<fmt:message key='CommonImagePath' />table_1_10.gif" width="7" /></td>
        <td background="<%=request.getContextPath() %>/<fmt:message key='CommonImagePath' />table_1_11.gif">&nbsp;</td>
        <td><img height="22" alt="" src="<%=request.getContextPath() %>/<fmt:message key='CommonImagePath' />table_1_12.gif"  width="8" /></td>
      </tr>
    </tbody>
  </table>
  
</html:form>
</body>
</html>
 